package cn.xlbweb.sso.listener;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * @author: bobi
 * @date: 2019-03-24 18:50
 * @description:
 */
@Slf4j
public class SsoSessionListener implements HttpSessionListener {

    @Override
    public void sessionCreated(HttpSessionEvent se) {

    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        HttpSession session = se.getSession();
        Boolean isLogin = (Boolean) session.getAttribute("isLogin");
        if (isLogin == null) {
            log.info("局部session失效");
        }
    }
}
